package utils

import "encoding/base64"

// Base64加密字符串
func Base64Encode(s string) string {
	// return base64.URLEncoding.EncodeToString([]byte(s))
	return base64.StdEncoding.EncodeToString([]byte(s))
}

// Base64解密字符串
func Base64Decode(s string) (string, error) {
	// decoded, err := base64.URLEncoding.DecodeString(s)
	decoded, err := base64.StdEncoding.DecodeString(s)
	if err != nil {
		return "", err
	}
	return string(decoded), nil
}
